<?php
require_once("vcl/vcl.inc.php");
require_once("lib/db_connection.php");
//Includes
use_unit("forms.inc.php");
use_unit("extctrls.inc.php");
use_unit("stdctrls.inc.php");

//Class definition
class Add_Prospect extends Page
{
       public $edcontact_num = null;
       public $edcontact_person = null;
       public $Submit = null;
       public $Image1 = null;
       public $Button2 = null;
       public $Label5 = null;
       public $Label4 = null;
       public $edBusiness_address = null;
       public $Label3 = null;
       public $edEmail = null;
       public $edcomp_name = null;
       public $Label2 = null;
       public $Label1 = null;
       function Button2JSClick($sender, $params)
       {

       ?>
       window.close();

       <?php

       }



       function Add_ProspectCreate($sender, $params)
       {

       $this->edcomp_name->Text = '';
       $this->edBusiness_address->Text = '';
       $this->edEmail->Text = '';
       $this->edcontact_person->Text = '';
       $this->edcontact_num->Text = '';


       }




       function SubmitClick($sender, $params)
       {
       mysql_query("INSERT INTO prospects_tbl (comp_name,
       email_add,
       business_add,
       contact_person,
       contact_num)
       VALUES
       ('".$this->edcomp_name->Text."',
       '".$this->edEmail->Text."',
       '".$this->edBusiness_address->Text."',
       '".$this->edcontact_person->Text."',
       '".$this->edcontact_num->Text."')")or die (mysql_error());

       echo '<script language=javascript>
       window.opener.location.reload();
       alert("Successfully Added Record!");
       window.close();
       </script>';
       }

}

global $application;

global $Add_Prospect;

//Creates the form
$Add_Prospect=new Add_Prospect($application);

//Read from resource file
$Add_Prospect->loadResource(__FILE__);

//Shows the form
$Add_Prospect->show();

?>